package com.tengju.data.infrastructure.repository.convert;

import com.tengju.data.domain.model.report.DataAchivevmentBonusDateConfig;
import com.tengju.data.domain.model.report.DateConfigTypeEnum;
import com.tengju.data.infrastructure.persistence.mybatis.dataobject.DataAchievementBonusDateConfigDO;

/**
 * @author kezunfa
 */
public class DataAchievementBonusDateConfigConvert {

    public static DataAchivevmentBonusDateConfig toModel(DataAchievementBonusDateConfigDO configDO) {
        if (configDO == null) {
            return null;
        }

        return new DataAchivevmentBonusDateConfig(configDO.getDataKey(),
                DateConfigTypeEnum.fromType(configDO.getConfigType()),
                configDO.getStartTime(),
                configDO.getEndTime());
    }
}
